function abc()
{
   console.log( $("#course-select option:selected").val())
}
function init()
{
   post("http://"+ip+"/data/request/getAllCourse", {}, function (data) {
      if (data.code == 200&&data.t!=null) {
         var trs ="";
         $.each(data.t, function (a, b) {

            trs= trs+"<option>"+b+"</option>"

         })
         $("#course-select").empty();
         $("#course-select").append(trs);
            getClassByCourse()

      }
      else
      {
         alert(data.reason)
      }


   })
}
function getClassByCourse()
{


   post("http://"+ip+"/data/request/getClassByCourse",{
     courseName: $("#course-select option:selected").val()
   },function (data) {
      if (data.code == 200&&data.t!=null) {
         var trs ="";
         $.each(data.t, function (a, b) {

            trs= trs+"<option>"+b+"</option>"

         })
         trs=trs+"<option>全部班级"+"</option>";
         $("#cno-select").empty();
         $("#cno-select").append(trs);


      }
      else
      {
         alert(data.reason)
      }


   })
}
function addAssignment()
{
   post("http://"+ip+"/data/request/addAssignment",{
      courseName:$("#course-select option:selected").val(),
      cno:$("#cno-select option:selected").val(),
      assignmentName:$("#assignmentName").val(),
      detail:$("#detail").val()
   },function (data)
   {
      alert(data.reason)
   })
}